package com.yunxiao.cloud.auth.server.controller;

import com.yunxiao.cloud.auth.server.service.SysUserService;
import com.yunxiao.cloud.common.base.BaseResultResponse;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @description: LoginController
 * @author: yunxiao
 * @date: 2020/2/18 9:10
 * @version: V1.0
 **/
@Api(value = "Login登录", tags = {"Login登录"})
@Controller
public class LoginController {

    @Autowired
    SysUserService sysUserService;

    @ResponseBody
    @PostMapping("/test")
    public BaseResultResponse test(){
        return BaseResultResponse.ok(sysUserService.getUserByName("test"));
    }

    @GetMapping("/login")
    public String login() {
        return "login";
    }

    @GetMapping("/index")
    public String index() {
        return "index";
    }
}
